const data: PRESALE.Item[] = [
  {
    color: "blue",
    name: "张三",
    time: [
      {
        start_at: new Date("2023-07-12 10:30:00").getTime(),
        end_at: new Date("2023-07-12 11:00:00").getTime(),
      },
      {
        start_at: new Date("2023-07-12 11:30:00").getTime(),
        end_at: new Date("2023-07-12 12:30:00").getTime(),
      },
      {
        start_at: new Date("2023-07-12 14:30:00").getTime(),
        end_at: new Date("2023-07-12 16:00:00").getTime(),
      },
    ],
  },
  {
    color: "green",
    name: "李四",
    time: [
      {
        start_at: new Date("2023-07-12 12:30:00").getTime(),
        end_at: new Date("2023-07-12 14:00:00").getTime(),
      },
      {
        start_at: new Date("2023-07-12 16:30:00").getTime(),
        end_at: new Date("2023-07-12 20:00:00").getTime(),
      },
      {
        start_at: new Date("2023-07-12 21:30:00").getTime(),
        end_at: new Date("2023-07-12 23:00:00").getTime(),
      },
    ],
  },
  {
    color: "black",
    name: "随机1",
    time: [
      {
        start_at: new Date("2023-07-12 10:30:00").getTime(),
        end_at: new Date("2023-07-12 11:00:00").getTime(),
      },
      {
        start_at: new Date("2023-07-12 11:30:00").getTime(),
        end_at: new Date("2023-07-12 12:00:00").getTime(),
      },
      {
        start_at: new Date("2023-07-12 14:30:00").getTime(),
        end_at: new Date("2023-07-12 16:00:00").getTime(),
      },
    ],
  },
  {
    color: "yellow",
    name: "随机3",
    time: [
      {
        start_at: new Date("2023-07-12 12:30:00").getTime(),
        end_at: new Date("2023-07-12 14:00:00").getTime(),
      },
      {
        start_at: new Date("2023-07-12 19:30:00").getTime(),
        end_at: new Date("2023-07-12 22:00:00").getTime(),
      },
      {
        start_at: new Date("2023-07-12 23:30:00").getTime(),
        end_at: new Date("2023-07-12 24:00:00").getTime(),
      },
    ],
  },
  {
    color: "pink",
    name: "随机2",
    time: [
      {
        start_at: new Date("2023-07-12 10:00:00").getTime(),
        end_at: new Date("2023-07-12 12:00:00").getTime(),
      },
      {
        start_at: new Date("2023-07-12 14:30:00").getTime(),
        end_at: new Date("2023-07-12 22:00:00").getTime(),
      },
    ],
  },
  {
    color: "green",
    name: "随机3",
    time: [
      {
        start_at: new Date("2023-07-12 11:30:00").getTime(),
        end_at: new Date("2023-07-12 12:00:00").getTime(),
      },
      {
        start_at: new Date("2023-07-12 14:30:00").getTime(),
        end_at: new Date("2023-07-12 22:00:00").getTime(),
      },
    ],
  },
];

for (let i = 0; i < data.length; i++) {
  const item = data[i];
  for (let j = 0; j < item.time.length; j++) {
    const nowTime = new Date("2023-07-12 10:00:00").getTime();
    data[i].time[j].left = (data[i].time[j].start_at - nowTime) / 1000 / 60;
    data[i].time[j].width =
      (data[i].time[j].end_at - data[i].time[j].start_at) / 1000 / 60;
  }
}

export default data;
